﻿// Decompiled with JetBrains decompiler
// Type: Netick.Unity.NetworkSceneHandler
// Assembly: Netick.Unity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E128C7FD-39ED-4452-86AC-6EC748457030
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.Unity.xml

using UnityEngine.SceneManagement;

#nullable disable
namespace Netick.Unity;

public abstract class NetworkSceneHandler : NetworkEventsListener
{
  internal ISceneOperation InvokeLoadCustomSceneAsync(
    int index,
    LoadSceneParameters loadSceneParameters,
    out string sceneName)
  {
    return this.LoadCustomSceneAsync(index, loadSceneParameters, out sceneName);
  }

  internal ISceneOperation InvokeUnloadCustomSceneAsync(Scene scene)
  {
    return this.UnloadCustomSceneAsync(scene);
  }

  internal ISceneOperation InvokeLoadBuildSceneAsync(
    int buildIndex,
    LoadSceneParameters loadSceneParameters)
  {
    return this.LoadBuildSceneAsync(buildIndex, loadSceneParameters);
  }

  internal ISceneOperation InvokeUnloadBuildSceneAsync(Scene scene)
  {
    return this.UnloadBuildSceneAsync(scene);
  }

  public abstract int CustomScenesCount { get; }

  protected abstract ISceneOperation LoadCustomSceneAsync(
    int index,
    LoadSceneParameters loadSceneParameters,
    out string sceneName);

  protected abstract ISceneOperation UnloadCustomSceneAsync(Scene scene);

  protected virtual ISceneOperation LoadBuildSceneAsync(
    int buildIndex,
    LoadSceneParameters loadSceneParameters)
  {
    return (ISceneOperation) new BuildSceneOperation(SceneManager.LoadSceneAsync(buildIndex, loadSceneParameters));
  }

  protected virtual ISceneOperation UnloadBuildSceneAsync(Scene scene)
  {
    return (ISceneOperation) new BuildSceneOperation(SceneManager.UnloadSceneAsync(scene));
  }
}
